package com.iwop.moto.service.impl;

import com.iwop.moto.dao.MGPOrderServiceDao;
import com.iwop.moto.model.MGPOrder;
import com.iwop.moto.service.MGPOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by mobom on 2016/12/28.
 */

@Service
public class MGPOrderServiceImpl implements MGPOrderService {

    @Autowired
    MGPOrderServiceDao mgpOrderServiceDao;

    @Override
    public int insetMGPOrder(MGPOrder mgpOrder) {
        return  mgpOrderServiceDao.insert(mgpOrder);
    }

    @Override
    public MGPOrder findOneBySid(String orderNo) {
        return mgpOrderServiceDao.findOneById(orderNo);
    }

    @Override
    public List<MGPOrder> findGPOrderByStoreId(String store_id, int row, int offset) {
        return mgpOrderServiceDao.findGPOrderByStoreId(store_id, row, offset);
    }

    @Override
    public void updateMGPOrder(MGPOrder mgpOrder) {
        mgpOrderServiceDao.update(mgpOrder);
    }

    @Override
    public Long countMGPOrderByStoreId(String store_id) {
        return mgpOrderServiceDao.countMGPOrderByStoreId(store_id);
    }

    @Override
    public MGPOrder findGPOrderByPayOutTradeNo(String out_trade_no) {
        return mgpOrderServiceDao.findGPOrderByPayOutTradeNo(out_trade_no);
    }

}
